package user

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"

	"gitee.com/liuxuezhan/ar-platform/rpc-client/userServiceClient/userrpc"
	"github.com/zeromicro/go-zero/core/logx"
)

type UserGroupUpdateStatusLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 会员管理 - 会员管理 - 分组管理: 更新状态
func NewUserGroupUpdateStatusLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserGroupUpdateStatusLogic {
	return &UserGroupUpdateStatusLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UserGroupUpdateStatusLogic) UserGroupUpdateStatus(req *types.GroupStatusUpdateRequest) (resp *types.GroupStatusUpdateResponse, err error) {
	_, err = l.svcCtx.UserServiceRPC.UserGroupStatusUpdate(l.ctx, &userrpc.UserGroupStatusUpdateRequest{
		GroupId: req.GroupId,
		Close:   req.Close,
	})
	return
}
